package com.saicyc.demo.controller;

import com.saicyc.demo.application.NewsApplication;
import com.saicyc.demo.vo.ResultVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@CrossOrigin
@RestController
@RequestMapping("news")
public class NewsController extends BaseContoller{


    @Resource
    private NewsApplication newsApplication;

    @GetMapping("/{id}/user_releation")
    private ResultVo<Boolean> findUserReleationGood(@PathVariable Long id){
        Boolean flage = newsApplication.findUserReleationGood(id,getUserId());
        return new ResultVo(flage);
    }


    @PostMapping("/{id}/user_releation")
    public ResultVo<Boolean> upsertUserRelationGood(@PathVariable Long id){
        Boolean flage = newsApplication.upsertUserRelationGood(id,getUserId());
        return new ResultVo(flage);
    }


}
